import { get, post, put, del } from '@/utils/request'

/**
 *列表
 * @returns
 */
export const loadModelsAPI = (page) =>
  get('/api/v1/admin/productcategory', { page })

/**
 * 新增
 * @param {*} data
 * @returns
 */
export const addModelAPI = (data) => post('/api/v1/admin/productcategory', data)

/**
 * 修改
 * @param {*} id
 * @param {*} data
 * @returns
 */
export const updataModelByIdAPI = (id, data) =>
  put('/api/v1/admin/productcategory/' + id, data)

/**
 * 根据id获取详情
 * @param {*} id
 * @returns
 */
export const loadModelByIdAPI = (id) =>
  get('/api/v1/admin/productcategory/' + id)

/**
 * 根据id删除
 * @param {*} id
 * @returns
 */
export const delModelByIdAPI = (id) =>
  del('/api/v1/admin/productcategory/' + id)
